package com.hong610.quartz;

import org.quartz.*;
import org.quartz.impl.JobDetailImpl;
import org.quartz.impl.StdSchedulerFactory;
import org.quartz.impl.triggers.CronTriggerImpl;

import java.text.ParseException;

/**
 * Created by Hong on 2017/2/8.
 */
public abstract class Quartz {

    private static SchedulerFactory sf = new StdSchedulerFactory();//获取scheduler对象，用quartz默认的

    private Scheduler scheduler = null;

    /**
     * 获取 Scheduler
     */
    public Scheduler getScheduler(){
        try {
            scheduler = sf.getScheduler();
        } catch (SchedulerException e) {
            e.printStackTrace();
        }
        return scheduler;
    }
}
